package com.example.pictureManage.service.imageDetailService;

import javafx.scene.image.ImageView;

/**
 * 图片缩放器
 */
public class imageZoom {
    //放大
    public void handleUp(ImageView imageView){
        double imageH = imageView.getFitHeight();
        double imageW = imageView.getFitWidth();

        double ZOOM_FACTOR = 1.2;
        imageView.setFitHeight(imageH * ZOOM_FACTOR);
        imageView.setFitWidth(imageW * ZOOM_FACTOR);
    }
    //缩小
    public void handleDown(ImageView imageView){
        double imageH = imageView.getFitHeight();
        double imageW = imageView.getFitWidth();

        //缩小比例
        double ZOOM_FACTOR = 0.8;
        imageView.setFitHeight(imageH * ZOOM_FACTOR);
        imageView.setFitWidth(imageW * ZOOM_FACTOR);
    }
}
